// using confirmOnSubmit class to determine buttons needs confirmation before submission
$('.confirmOnSubmit').click(function(event){
    var $button = $(this);
	// taking button server generated id
    var id = $button.attr('id');
	// prevent button to trigger anything on click
    event.preventDefault();
	
    $('#confirmDialog').dialog({
        modal: true,
        buttons: {
            Ok: function () {
				// if button is prevented to do anything
                if(event.isDefaultPrevented()) {
					// navigate to href attribute on button
                    window.location = $button.attr('href');
                }
                $(this).dialog('close');
                return true;
            },
            Cancel: function () {
                $(this).dialog('close');
                return false;
            }
        }
    });
});